import request from '@/utils/request'

// 热门搜索相关的数据接口
export interface HotKeywordVOModel {
    keyword: string,
    schemeUrl: null,
    highlight: number,
    hidden: number,
    type: number,
    algSort: boolean,
}
export type HotKeywordVOListModel = HotKeywordVOModel[]
export default {
    // 获取到热门搜索的列表
    getHotKeywordList(){
        return request.get('/wyyx/xhr/search/init.json')
    },
    // 根据关键字获取到商品列表数据
    getSearchGoodsList(keyword:string){
        return request.get(`/wyyx/xhr/search/search.json?__timestamp=1630133434953&needPopWindow=true&searchWordSource=7&stillSearch=false&_stat_search=autoComplete&itemId=0&size=40&upperPrice=-1&floorPrice=-1&matchType=0&categoryId=0&descSorted=false&sortType=0&keyword=${keyword}`)
    },
    // 实时获取搜索列表
    getRealTimeKeywordList(keywordPrefix:string){
        return request.get(`/wyyx/xhr/search/searchAutoComplete.json?keywordPrefix=${keywordPrefix}`)
    }
}